import Mock from 'mockjs';
import setupMock from './setupMock';
setupMock({
  setup: () => {
    Mock.mock(new RegExp('/api/login'), 'post', (params) => {
      const { username, password } = JSON.parse(params.body);
      if (username == 'admin' && password == '123456') {
        return {
          code: 200,
          msg: '',
          data: {
            token: 'token',
          },
        };
      } else {
        return {
          code: 400,
          msg: '用户名或密码错误',
        };
      }
    });
  },
});
